package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdOrderCustomerEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdOrderCustomerCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdOrderCustomerUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdOrderCustomerResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 订单与消费者关联 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdOrderCustomerConverter implements BaseConverter<
        OfdOrderCustomerEntity,
        OfdOrderCustomerCreateParam,
        OfdOrderCustomerUpdateParam,
        OfdOrderCustomerResult> {
    @Override
    public OfdOrderCustomerEntity fromParam(OfdOrderCustomerCreateParam param) {
        OfdOrderCustomerEntity entity = new OfdOrderCustomerEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdOrderCustomerEntity fromUpdateParam(OfdOrderCustomerUpdateParam param) {
        OfdOrderCustomerEntity entity = ConvertUtil.convert(param, OfdOrderCustomerEntity.class);
        return entity;
    }

    @Override
    public OfdOrderCustomerResult toResult(OfdOrderCustomerEntity entity) {
        OfdOrderCustomerResult result = ConvertUtil.convert(entity,OfdOrderCustomerResult.class);
        return result;
    }
}